#include "../include/Ressource.h"

Ressource::Ressource( int bois, int nourriture, int metal)
{
	this->bois = bois;
	this->nourriture = nourriture;
	this->metal = metal;
}

Ressource operator+(Ressource const& a, Ressource const& b)
{
    return Ressource(a.getBois()+b.getBois(), a.getNourriture()+b.getNourriture(), a.getMetal()+b.getMetal());
}
Ressource operator-(Ressource const& a, Ressource const& b)
{
    return Ressource(a.getBois()-b.getBois(), a.getNourriture()-b.getNourriture(), a.getMetal()-b.getMetal());
}
bool operator>=(Ressource const& a, Ressource const& b)
{
    return ( a.getBois()>=b.getBois() && a.getNourriture()>=b.getNourriture() && a.getMetal() >= b.getMetal());
}
bool operator>(Ressource const& a, Ressource const& b)
{
    return( a.getBois()>b.getBois() && a.getNourriture()>b.getNourriture() && a.getMetal() > b.getMetal());
}
bool operator<=(Ressource const& a, Ressource const& b)
{
    return( b >= a);
}
bool operator<(Ressource const& a, Ressource const& b)
{
    return ( b > a);
}
std::ostream& operator<<( std::ostream &flux, Ressource const& r )
{
    flux << "Bois :"<< r.getBois()<< ",  Nourriture :"<< r.getNourriture() << ",  Metal :"<< r.getMetal()<<std::endl;
}
int Ressource::getBois() const
{
    return bois;
}

/** @brief (one liner)
  *
  * (documentation goes here)
  */
int Ressource::getMetal() const
{
    return metal;
}
/** @brief (one liner)
  *
  * (documentation goes here)
  */
int Ressource::getNourriture() const
{
    return nourriture;
}
